#ifndef __DB_OPERATION_H__ 
#define __DB_OPERATION_H__ 
#include "codon.h"
#include "CppSQLite3.h"

const int acidNum = 21;
static const char *DBFilePath = "C:\\biology.db";

struct speciesRNA
{
	vector<char> RNA;
	int speciesNum;
};

class db
{
private:
	int	speciesCount;
	vector<SpeciesCodon> speciesCodon;
	speciesRNA inSeq, outSeq;	
	CppSQLite3DB database;

public:
	db();
	~db();
	//read codon data from file and add in 
	bool AddSpecies(const char *fileName);
	//insert all codon info into DB
	void CreateTable(void);
	void InsertCodon(void);
	//select test
	void Select(void);
	//count species number
	int	 SetSpeciesCount(void);
	//codon join table calculation among species
	bool RankTableCal(void);
	//input sql to implement
	void ExecSql(const char *sqlexec);

	//read original data from file, and translate data into RNA sequences
	//need to refer DB for protein translation, output RNA stored in inputRNA
	bool translateRNAFromFile(const char *fileName, int speciesNum);
	//transform RNA among species according to aminoAcid rank
	bool speciesRNATransform(int speciesNum2);
	void printSequences(void);
};

#endif __DB_OPERATION_H__ 